<style> /* 	input,.btn{margin-top: 20px;} */ .code{width: 110px;height: 38px;border: 0px solid black;position:absolute;right:0;  margin-top: -42px;margin-right: 3px;} a{color: black;} .content-middle-body > input, .content-middle-body > button, .content-middle-body > a { margin-top:12px; margin-bottom: 12px; } .icon { width: 1em; height: 1em; vertical-align: -0.15em; fill: currentColor; overflow: hidden; } .col-sm-4, .col-xs-12 { padding-left:0; padding-right:0; } .div-c-chooseChatWrapper, .div-c-chooseChatWrapper > div { display:flex; align-items:center; } .div-c-chooseChatWrapper > div > span { margin-left:16px; } .modal-body .div-c-chooseChatWrapper + .div-c-chooseChatWrapper { border-top:1px solid #cecece; } .div-c-chooseChatWrapper { justify-content:space-between; padding:2vh; } .div-c-chooseChatWrapper svg { width:6vh; height:6vh; max-width:40px; max-height:40px; } p{color:#6084C2;font-size:13px;text-align: left;margin-top: 10px;} </style>
<div class="wapper" id="tryplay">
		<div class="bg-theme text-center top clearfix col-xs-12 col-sm-4 col-sm-offset-4">
			<a  class="glyphicon glyphicon-chevron-left" onclick="backPage()" style="color: white;top: 50%;transform:translateY(-50%);left:10px;position: absolute;cursor: pointer;"></a>
			<span>试玩用户</span>
		</div>
		<div class="text-center clearfix content-middle-body scroll col-xs-12 col-sm-4 col-sm-offset-4" style="padding-left:30px;padding-right:30px;margin-top:60px;">
			<!-- 正文开始 -->
			<input id="name" type="text" value="" maxlength="20" class="form-control input-lg" ></input>
			<input id="pass" type="password" placeholder="请输入密码[6~10]" maxlength="10" class="form-control input-lg"></input>
			<span id="notice" style="width:100%;color: red;border: 0;display: block;font-size: 16px;text-align: left;"></span>
			<button id="tryplay1" class="btn btn-lg pm bg-theme">免费试玩</button>
			<!-- 正文结束 -->
			<p style="margin-top: 30px;">
				1、每个试玩账号初始金额为2000人民币，不允许充值
			</p>
			<p>
				2、每个IP只允许有3个试玩账号;
			</p>
			<p>
				3、试玩账号只提供玩家熟悉游戏，不允许充值和提现;
			</p>
			<p>
				4、试玩张号不享有参加优惠活动的权利;
			</p>
		</div>
		
		
<div class="modal-div-fakeModal" id="div-i-noticeGenDan1" data-lock="false">
	<div class="div-c-modalContent">
		<h3 class="fakemodal-title"></h3>
		<div class="fakemodal-content"></div>
		<div class="fakemodal-btnsGroup"><button class="btn btn-default btn-class-closeFakeModal">关闭</button></div>
	</div>
	</div>
</div>	
<script>
	fixHeadAndFoot();
	 setContentBodyHeight();
	$.ajax({
			url: "/u/tryPlayAcount.do",
			type: "post",
			data: {},
			success: function(data) {
				if(data == 50) { 
					save.push("sy");
					bindSetData("login"); 
					return;
	   			}else if(data==60){
	   				pagePreserve();
	   				return;
	   			}
				$("#name").val(data.data);
			},
		});
	     
		$("#kefuModal").on(getEndClickEvent(), ".div-c-chooseChatWrapper", function(event) {
			var self = event.currentTarget;
			var qqNum = self.dataset.qqnum;
			if (self.dataset.type == "qq") {
				location.href = "http://wpa.qq.com/msgrd?v=3&uin=" + qqNum + "&site=qq&menu=yes";
			} else {
				location.href = "/chat/kefu.do";
			}
		});     
		
	     $("#a-i-forgetPassWord").on(getEndClickEvent(), function(e) {
	    	 e.preventDefault();
	    	 $("#kefuModal").modal("show");
	     });
	$.ajax({
		url: "/cplays.do",
		type: "post",
		data: {},
		success: function(data) {	
			if(data == 50) { 
				save.push("sy");
				bindSetData("login"); 
				return;
   			}else if(data==60){
   				pagePreserve();
   				return;
   			}
			if (data.data == 1) {
				$("#tryplay1").addClass("active");
			}
		},
	});
	$("#tryplay1").click(function(){
		if(isNull()!="ok"){
			showNormalNoticeModal("#div-i-noticeGenDan1", "提示：", isNull());
			$(".btn-class-closeFakeModal").on("click",function(){
				$("#div-i-noticeGenDan1").attr("data-lock","false");
				$("#div-i-noticeGenDan1").hide();
			});
			return;
		}
		$.ajax({
			url:'/u/tryplay.do',
			data:{name:$("#name").val(),pass:$("#pass").val()},
			type:'post',
			success:function(data){
				if(data == 50) { 
					save.push("sy");
					bindSetData("login"); 
					return;
	   			}else if(data==60){
	   				pagePreserve();
	   				return;
	   			}
				$("html").css("font-size","12px");
				if(data.message==1){
					$(".foot").hide();
					$(".kd-loading").show();
					$("#xfm").hide();
					userLoginData();
					bindSetData("sy");
					$(".dhssdhgbsdfg a").removeClass("active");
					$(".dhssdhgbsdfg").find(".sy").addClass("active");
				 }else if(data.message == 2){
					showNormalNoticeModal("#div-i-noticeGenDan1", "提示：", '注册次数过多，请明日注册');
				 }else if(data.message == 3){
					showNormalNoticeModal("#div-i-noticeGenDan1", "提示：", '用户名已存在请手动更换用户名');
			 	 }
			 },
		});
	});
		function isNull(){
			if($("#name").val()==""||$("#name").val()==null) return "用户名不能为空";
			else if($("#pass").val()==""||$("#pass").val()==null) return "密码不能为空";
			else if ($("#pass").val().length<6||$("#pass").val().length>16) return "密码不能小于6位或大于16位";
			else return "ok";
		}
	</script>
